/*
 * Created on Aug 20, 2005
 * Copyright 2005 Program of Computer Grpahics, Cornell University
 */
package ray;

import java.util.Random;

import ray.math.Color;
import ray.math.Vector3;

public class Calc {

  /** Space for the eye ray intersection record */
  public final Intersection eyeRecord = new Intersection();

  /** Space for the shadow ray intersection record */
  public final Intersection shadowRecord = new Intersection();

  /** Space for an eye ray */
  public final Ray eyeRay = new Ray();
  
  /** Space for a shadow ray */
  public final Ray shadowRay = new Ray();

  /** Space for eye vector calculations * */
  public final Vector3 toEye = new Vector3();

  /** Space for light vector calculations * */
  public final Vector3 toLight = new Vector3();

  /** Space for the BRDF color * */
  public final Color color = new Color();
  
  /** Space for the active pixel color */
  public final Color pixelColor = new Color();
  
  /** Space for the active ray color */
  public final Color rayColor = new Color();

  /** A random number generator **/
  public final Random random = new Random();
  
  public Vector3 getToEye() {
      Vector3 result = new Vector3();
      result.sub(eyeRay.p, eyeRecord.intersection);
      result.normalize();
      return result;
  }
}
